Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cockroachdb cluster version fixups #6396

Merged
merged 3 commits into from
Aug 22, 2024
Merged

cockroachdb cluster version fixups #6396

merged 3 commits into from
Aug 22, 2024

Conversation

iliana
Copy link
Contributor

@iliana iliana commented Aug 20, 2024

This is a followup to #5603, which contains various fixes I needed to write when testing an actual cluster upgrade from v22.1 to v22.2.

We're currently deciding to park that plan, but I don't want these fixups to be forgotten.

@iliana iliana changed the title add infrastructure for prev_cockroachdb_version cockroachdb cluster version fixups Aug 20, 2024
Comment on lines +589 to +592
Os::Illumos => (
"https://oxide-cockroachdb-build.s3.us-west-2.amazonaws.com",
"tar.gz",
),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The v22.1.9 artifact in this bucket is the same as the one found at the old URL, but I wanted to keep this consistent with the documentation in docs/crdb-upgrades.adoc.

Comment on lines +161 to +164
} else if settings.preserve_downgrade == version.to_string() {
// This is the expected value if the cluster was created on a
// previous version and `cluster.preserve_downgrade_option` was set.
assert_eq!(version, CockroachDbClusterVersion::POLICY);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case needs to be added if, as part of doing tests, we create a cluster on an old version of CockroachDB and then set the cluster.preserve_downgrade_option setting before starting the test.

Comment on lines 263 to 274
// Fill in the blueprint with the current value of the option in
// the database.
CockroachDbClusterVersion::from_str(
&cockroachdb_settings.preserve_downgrade,
)
.map_err(|_| {
Error::internal_error(&format!(
"database has `cluster.preserve_downgrade_option` \
set to invalid version {}",
cockroachdb_settings.preserve_downgrade
))
})?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch should never be hit when bringing up a new control plane; this is here for the case where a CockroachDB cluster is created and cluster.preserve_downgrade_option is set before we run rack initialization as part of a test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I suppose we could remove this branch for this PR and re-learn that we need it if we do a cluster upgrade...)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd vote to keep the branch but add a comment (maybe https://github.com/oxidecomputer/omicron/pull/6396/files#r1724096463 more or less word-for-word).

@iliana iliana requested a review from jgallagher August 20, 2024 23:38
Copy link
Contributor

@jgallagher jgallagher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

} else {
panic!(
"`cluster.preserve_downgrade_option` should not be {:?}",
settings.preserve_downgrade
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny nit - maybe include version in this panic string, so we know what it should have been?

Comment on lines 263 to 274
// Fill in the blueprint with the current value of the option in
// the database.
CockroachDbClusterVersion::from_str(
&cockroachdb_settings.preserve_downgrade,
)
.map_err(|_| {
Error::internal_error(&format!(
"database has `cluster.preserve_downgrade_option` \
set to invalid version {}",
cockroachdb_settings.preserve_downgrade
))
})?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd vote to keep the branch but add a comment (maybe https://github.com/oxidecomputer/omicron/pull/6396/files#r1724096463 more or less word-for-word).

@iliana iliana enabled auto-merge (squash) August 22, 2024 01:41
@iliana iliana merged commit 1903eee into main Aug 22, 2024
23 checks passed
@iliana iliana deleted the iliana/crdb-prev branch August 22, 2024 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants